import numpy as np
from mat import Cube

def s7_4():
    print("7.3 (1)")
    T = np.array((
        (1, 0, 0, 0),
        (0, 1, 0, 0),
        (0, 0, 1, 0),
        (0, -2, 0, 1)
    ))
    print("T =")
    print(T)
    c = Cube(((0, 0, 0, 1), (1, 0, 0, 1), (1, 1, 0, 1), (0, 1, 0, 1),
              (0, 0, 2, 1), (1, 0, 2, 1), (1, 1, 2, 1), (0, 1, 2, 1)))
    print(str(c))
    print('-----')    
    print(c*T)

    print("7.3 (2)")
    T = np.array((
        (np.cos(60*np.pi/180), np.sin(60*np.pi/180), 0, 0),
        ( -np.sin(60*np.pi/180), np.cos(60*np.pi/180), 0, 0),
        (0, 0, 1, 0),
        (0, 0, 0, 1)
    ))
    print("T =")
    print(T)
    print(str(c))
    print('-----')    
    print(c*T)
if __name__ == "__main__":
    s7_4()

